def isPrime(n):
    i = 2
    while i < n:
        if n % i == 0:
            return False
        i += 1
    return True


num = 2
print("1000内的回文素数如下：")
while num < 1000:
    if isPrime(num):
        if num < 10:
            print(num)
        elif num < 100 and int(num / 10) == int(num % 10):
            print(num)
        elif int(num / 100) == int(num % 10):
            print(num)
    num += 1


